<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量与赋值</title>

    <script>
        // 只有z会被赋值
        var x, y, z = 10;
        // x=y=z=10; // 此方法所有都会被赋值

        function x() {
            alert("x=" + x);
        }
        console.log("x=" + x);
        console.log("z=" + z);

        // 类型转换
        var num = 35;
        console.log(typeof(num))
        console.log(typeof(num.toString()))
    </script>
</head>

<body>
    <p>var x,y,z = 10</p>
    <button onclick="x()">查看x的值</button>
</body>

</html>